<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>部门积分管理</title>
<link rel="stylesheet" href="__CSS__/pintuer.css?v={$src_version}">
<link rel="stylesheet" href="__CSS__/admin.css?v={$src_version}">
<link rel="stylesheet" href="__CSS__/responsive.css?v={$src_version}">
<script src="__JS__/jquery-3.2.1.min.js?v={$src_version}"></script>
<script src="__JS__/pintuer.js?v={$src_version}"></script>
<script src="__JS__/jquery.nicescroll.js"></script>
<script src="__PUBLIC__/layer.js?v={$src_version}"></script>
<script src="__JS__/ming.js?v={$src_version}"></script>
<script src="__JS__/responsive.js?v={$src_version}"></script>
</head>
<body>
<div class="panel admin-panel">	
	<a class="button border-yellow" onclick="out('{:U(\'Branch/Add\')}','','','确认添加','')" style="display:block;width:80px;padding:3px 5px; ">
	<span class="icon-plus-square-o"></span>添加部门</a>
	<table class="table table-hover text-center table-one">
		<tr>
			<th>名称</th>
			<th>操作</th>
		</tr>
		<volist name="list" id="vo" key="i">
			<tr style="background: #f2f9fd">
				<td>{$vo.brank_name}</td>
				<td>
					<a class="button border-main" onclick="out('{:U(\'Branch/Edit\')}','{$vo.id}','{$vo.brank_name}','确认修改','')"><span class="icon-edit"></span>修改</a>
					<a class="button border-red" onclick="out('{:U(\'Branch/Del\')}','{$vo.id}','{$vo.brank_name}','确认删除','true')"><span class="icon-trash-o"></span>删除</a>
				</td>
				<td></td>
				<td></td>
			</tr>
		</volist>
	</table>
</div>
	<div id="integral" style="display: none;padding: 10px">
		<form class="layer-form" id="form1" action=" " name="form1" method="POST">
			<input type="text" name="id" id="id" value="" style="display: none;">
			<div class="layer-form-item">
				<label class="layer-form-label">部门名称：</label>
				<div class="layer-input-inline">
					<input class="layer-input" type="text" name="branck_name" id="branck_name" value="" placeholder="请输入部门名称" />
				</div>
			</div>
			<div class="layer-form-item">
				<div class="layer-input-block">
					<input class="layer-btn" type="submit" id="submit" value="">
				</div>
			</div>
		</form>
	</div>
</body>
	<script>
		function out(url,id,branck,submit,readonly)
		{
			document.getElementById('form1').action=url;
			document.getElementById('id').value=id;
			document.getElementById('branck_name').value = branck;
			document.getElementById('submit').value = submit;
			if(readonly != '')
			{
				document.getElementById('branck_name').readOnly=readonly;
			}
			layer.open({
				title:'操作',
				type: 1,
				content: $('#integral'),
			});
			
		}
		function out1(url,cid,branch_id,category_name,opt,add_number,submit1,readonly,min_jifen=0,mix_jifen=0)
		{
			var form = document.getElementById('integral');
			form.innerHTML = "<form action=' ' name='form2' method='POST' />\
							 <input type='number' name='cid' id='cid' value=' ' style='display:none;' >\
							 <input type='number' name='branch_id' id='branch_id' value=' ' style='display:none;' >\
							 <div class='layer-form-item'>\
								<label class='layer-form-label'>项目名称：</label>\
								<div class='layer-input-inline'>\
									<input class='layer-input' type='text' name='category_name' id='category_name' value=' ' placeholder='请输入项目名称'>\
								</div>\
							</div>\
							<div class='layer-form-item'>\
								<label class='layer-form-label'>选择加/减分：</label>\
								<div class='layer-input-inline'>\
										<select class='layer-select' name='opt' id='opt'>\
											<option value='+'>加分项目</option>\
											<option value='-'>减分项目</option>\
										</select>\
								</div>\
							</div>\
							<div class='layer-form-item'>\
								<label class='layer-form-label'>最小积分：</label>\
								<div class='layer-input-inline'>\
									<input class='layer-input' type='number' name='min_jifen' value=' ' id='min_jifen' request placeholder=''>\
								</div>\
							</div>\
							<div class='layer-form-item'>\
								<label class='layer-form-label'>最大积分：</label>\
								<div class='layer-input-inline'>\
										<input class='layer-input' type='number' name='mix_jifen' value=' ' id='mix_jifen' request placeholder=''>\
								</div>\
							</div>\
							<div class='layer-form-item'>\
								<div class='layer-input-block'>\
									<input class='layer-btn' type='submit' id='submit1' value=' '>\
								</div>\
							</div>\
							 </form>";
			document.form2.action=url;
			document.getElementById('cid').value=cid;
			document.getElementById('branch_id').value = branch_id;
			document.getElementById('category_name').value = category_name;
			document.getElementById('opt').value=opt;
			document.getElementById('min_jifen').value=min_jifen;
			document.getElementById('mix_jifen').value=mix_jifen;
			document.getElementById('submit1').value=submit1;
			if (readonly != '') 
			{
				document.getElementById('category_name').readOnly = true;
				document.getElementById('number_add').readOnly = true;
				document.getElementById('add_number').readOnly = true;
			}
			layer.open({
				title:'操作',
				type: 1,
				content: $('#integral'),
			});
			
		}
		$('body').on('click','.layui-layer-close',function(){
			location.reload();
		})
	</script>

</html>